#include <QCoreApplication>
#include<QFile>
#include<QTextStream>

int main(int argc, char *argv[])
{
    QCoreApplication a(argc, argv);

    QFile data("test.txt");
    if(data.open(QFile::WriteOnly|QFile::Truncate)){
        QTextStream out(&data);
        out << "Result: "<<qSetFieldWidth(10)<<left<<3.14 << 2.7;

    }
    QFile file("in.txt");
    if(!file.open(QIODevice::ReadOnly|QIODevice::Text)){
        return 0;
    }
    while (!file.atEnd()) {
        QByteArray line = file.readLine();

    }
    QFile file2("in.txt");
    if(!file2.open(QIODevice::ReadOnly|QIODevice::Text)){
        return 0;
    }
    QTextStream in(&file2);
    while (!in.atEnd()) {
        QString line = in.readLine();

    }

    return a.exec();
}
